package arraysSort;

public class Demo1 {

	public static void main(String[] args) {
		int x[] = {1,2,3,4,5 };
		int temp=0;
		int localtion=0;
		for (int i = 0; i < x.length; i++) {
		    temp = x[i];
		    localtion = i;
			for (int j = i+1; j < x.length; j++) {
				if (temp > x[j]) {
					
					temp = x[j];
					localtion = j;
				}
			}
			x[localtion]=x[i];
			x[i]=temp;
			

		}
		for (int i = 0; i < x.length; i++) {
			System.out.println(x[i]);
		}
	}
	
}
